package cn.jltx.rxjava.rx;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;

import butterknife.ButterKnife;
import butterknife.OnClick;
import cn.jltx.rxjava.rx.learn.RxJava2Learn2;

/**
 * @author jltxseo
 * Created by junlintianxia on 2017/08/11.
 */

public class Learn2Activity extends AppCompatActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_learn2);
        setTitle("笔记二");
        ButterKnife.bind(this);
    }

    @OnClick({R.id.btn1, R.id.btn2, R.id.btn3, R.id.btn4, R.id.btn5, R.id.btn6, R.id.btn7, R.id.btn8,
            R.id.btn9, R.id.btn10, R.id.btn11, R.id.btn12, R.id.btn13, R.id.btn14, R.id.btn15,R.id.btn16,R.id.btn17})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.btn1:
                RxJava2Learn2.justOperator();
                break;
            case R.id.btn2:
                RxJava2Learn2.fromArrayOperator();
                break;
            case R.id.btn3:
                RxJava2Learn2.fromIterableOperator();
                break;
            case R.id.btn4:
                RxJava2Learn2.mapOperator();
                break;
            case R.id.btn5:
                RxJava2Learn2.mapOperator1();
                break;
            case R.id.btn6:
                RxJava2Learn2.flatMapOperator();
                break;
            case R.id.btn7:
                RxJava2Learn2.concatMapOperator();
                break;
            case R.id.btn8:
                RxJava2Learn2.flatMapIterableOperator();
                break;
            case R.id.btn9:
                RxJava2Learn2.filterOperator();
                break;
            case R.id.btn10:
                RxJava2Learn2.takeOperator();
                break;
            case R.id.btn11:
                RxJava2Learn2.mergeOperator();
                break;
            case R.id.btn12:
                RxJava2Learn2.mergeOperatorErro();
                break;
            case R.id.btn13:
                RxJava2Learn2.mergeDelayErrorOperatorErro();
                break;
            case R.id.btn14:
                RxJava2Learn2.zipOperator();
                break;
            case R.id.btn15:
                RxJava2Learn2.combineLatestOperator();
                break;
            case R.id.btn16:
                RxJava2Learn2.joinOperator();
                break;
            case R.id.btn17:
                RxJava2Learn2.concatOperator();
                break;
            default:
                break;
        }
    }
}
